package com.xjoyt.pay.master.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xjoyt.pay.vo.NotifyFormat;
import com.xjoyt.pay.vo.NotifyType;
import com.xjoyt.pay.vo.SignType;

/**
 * 商户设置
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name = "t_distributor_preference")
public class DistributorPreference {

	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "assigned")
	@Column(name = "distributor_preference_id", length = 36)
	public String id;

	/**
	 * 商户
	 */
	@OneToOne(targetEntity = Distributor.class, cascade = {})
	@JoinColumn(name = "distributor_id", foreignKey = @ForeignKey(name = "none"))
	@JsonIgnore
	public Distributor distributor;

	/**
	 * 回调格式( JSON, FORM ,GET)
	 */
	@Column(name = "notify_format", length = 20)
	@Enumerated(EnumType.STRING)
	public NotifyFormat notifyFormat;

	/**
	 * 回调加密方式(明文，部分加密，完全加密)
	 */
	@Column(name = "notify_type", length = 20)
	@Enumerated(EnumType.STRING)
	public NotifyType notifyType;

	/**
	 * 令牌
	 */
	@Column(name = "token", length = 50)
	public String token;

	/**
	 * 签名加密方式(MD5 , sha1)
	 */
	@Column(name = "sign_type", length = 20)
	@Enumerated(EnumType.STRING)
	public SignType signType;
}
